package org.tarry.springbootwebvalidation.controller;

import com.tarry.web.domian.vo.ResultEntity;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;
import org.tarry.springbootwebvalidation.domain.vo.CustomerQueryReq;
import org.tarry.springbootwebvalidation.domain.vo.CustomerReq;

import javax.validation.Valid;

@Slf4j
@RestController
public class CustomerController {

    @PostMapping("customer")
    public ResultEntity formValidation(@RequestBody @Valid CustomerReq req){
        log.debug("req: {}",req);
        return ResultEntity.success();
    }

    @PostMapping("customer/query")
    public ResultEntity query(@RequestBody @Valid CustomerQueryReq req){
        log.debug("req: {}",req);
        return ResultEntity.success();
    }


}
